<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="Mickael Faivre-Macon" />
	<meta name="keywords" content="movies" />
	<meta name="description" content="Movies" />
	<meta name="robots" content="all" />
	<title>Movies - Quels sont les meilleurs films &agrave; regarder ?</title>
	<%= javascript_include_tag "application", "prototype", "effects", "controls" %>
	<style type="text/css" title="currentStyle" media="screen">
		@import '/stylesheets/styles.css';
	</style>
	<link rel="Shortcut Icon" type="image/x-icon" href="/images/favicon.ico" />	
</head>
<body>
<div id="container">
<div id="logo">Movies</div>
<% cur = @controller.class.controller_path -%>
<ul id="header">
<span id="clock"><%=Date.today.strftime('%A %b %d %Y')%></span>
<% if session['user'] %>
<span <% if cur=="welcome" then%>id="currentmenuline" <%end%>class="menuline"><a href="/">r&eacute;sum&eacute;</a></span>
<span <% if cur=="movie" then%>id="currentmenuline" <%end%>class="menuline"><a href="/movie">films</a></span>
<span <% if cur=="myinfo" then%>id="currentmenuline" <%end%> class="menuline"><a href="/myinfo">profile</a></span>
<span id="logout"><a href="/account/logout">sortir</a></span>
<% else %>
<span id="currentmenuline" class="menuline"><a href="/">Home</a></span>
<span id="currentmenuline" class="menuline"><a href="/account">A propos</a></span>
<% end %>
</ul>
<div id="side">
<% if session['user'] %>
Bienvenue <%=session['user'].get_user['name']%>.<br/>
<br/>
<% else %>

<h3>Login</h3>
<%=link_to "Nouveau compte", :controller=>'account',:action=>'signup'%><br/>
<br/>
<div title="Account login" id="loginform" class="form">
<% form_tag :controller=>'account', :action=> "login" do %>
	Email:
   <input type="text" name="user[email]" id="user_email" size="10" value=""/><br/>
   Pwd :
   <input type="password" name="user[password]" id="user_password" size="10"/><br/>
   Or<br/>
    OpenID:
    <input type="text" name="openid_identifier" size="10"/><br/>
    <input type="submit" name="login" value="Login &#187;" class="submitbutton" /><br/>
    <br/>
    <img src="/images/openid.png">
    <a href="/account/openid?openid_identifier=https://www.google.com/accounts/o8/id">Sign with Google</a><br/>
    <% if @message %><div id="notice"><%= @message %></div><% end %>
<%= flash[:error] %>

<% end %>
<br/>
</div>

<% end %>
<br/>
<br/>
Derniers films:<br/>
<a href="http://movies.protaskm.com/movie/last.xml"><img src="/images/rss.jpg" border=0></a>
<br/>

<div id="notice"><% if flash[:notice] -%><h3>Notice</h3><%= flash[:notice] %><% end -%></div>
<div id="info"><% if flash[:info] -%><h3>Info</h3><%= flash[:info] %><% end -%></div>  
<div id="members"><% if flash[:members] -%><%= flash[:members] %><% end -%></div>  

</div>

<div id="content">

<% if session['user'] %>
Les notes vont de 0 à 10 maintenant (avant de 1 à 5).<br/>
J'ai fait (notes * 2 - 1) donc si yavait un film avec un 3/5 il aura 5/10, mais maintenant aucun film n'a 10/10.<br/>
Réajustez vos notes :)<br/>
<br/>
<% end %>


<% form_remote_tag(:url=>'/movie/search', :update=>'entry') do %>
<% if session['user'] %>
Recherche:
<%= text_field(:movie, :title) %>
<% end %>
<% end %>

<div id="entry">
<%
if @entry 
    opinions = @entry.opinions
    my = false
    my = session['user'].get_user.movies.include?(@entry) if session['user']
%>
<%= render(:partial=>'entry', :locals=>{:opinions=>opinions, :my=>my}) %>
<% end %>
</div>

<br/>

<div id="yield">
<%= yield %>
</div>

<p><br/></p>
</div>

<div id="footer">
Movies beta version |
Tested mainly with firefox |
For any ideas, please write to us: <a href="mailto:protask@protaskm.com">protask@protaskm.com</a>
</div>

</div>

</body>
</html>
